weblogindir = $(pkgdatadir)/web-login
cgidir = $(weblogindir)/cgi-bin

AM_CFLAGS=-Wall @xmlsec1_CFLAGS@ @libxml2_CFLAGS@ -DDATADIR=\"@datadir@\" -DSYSCONFDIR=\"@sysconfdir@\" -DLOCALSTATEDIR=\"@localstatedir@/charon\" @glib_CFLAGS@
AM_LDFLAGS=@xmlsec1_LIBS@ @libxml2_LIBS@ @glib_LIBS@ @ghttp_LIBS@ ../libcharon.la ../mcx/libmcx.la

lib_LTLIBRARIES = libprepaid.la

libprepaid_la_SOURCES = prepaid.c

noinst_HEADERS = prepaid.h

prepaid_SOURCES = cli.c
prepaid_LDADD = libprepaid.la

key_SOURCES = cgi-key.c
key_LDADD = libprepaid.la -lecgi

auth_SOURCES = cgi-auth.c
auth_LDADD = libprepaid.la -lecgi

bin_PROGRAMS = prepaid key auth

SUBDIRS = ui

install-data-local:
	mkdir -p $(DESTDIR)/$(cgidir)
	ln -sf $(bindir)/key $(DESTDIR)/$(cgidir)/key
	ln -sf $(bindir)/auth $(DESTDIR)/$(cgidir)/auth
